{_include admin_menu}

<div class="content_block col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<legend>จัดการกลุ่ม</legend>
	<a href="<?php echo base_url('admin/group/add'); ?>"  class="btn btn-primary pull-right" >เพิ่ม </a>
	 	<?php
	 	if(!empty($groups)){
	 	?>
	 		<table class="table">
	 		<thead>
				<tr>
					<th>ID</th>
					<th>Group Name  </th>
					<th>Description</th>
					<th>Edit & Del</th>
				</tr>
			</thead>
			<tbody >
	 	<?php
	 		foreach($groups as $group) {
	 	?>
				<tr>
					<td  class="span2"><?php echo $group['id']; ?></td>
					<td><?php echo $group['name']; ?></td>
					<td><?php echo $group['description']; ?></td>
					<td class="span2">
						
						<a href="<?php echo base_url('admin/group/add/'.$group['id']); ?>"  class="btn btn-success">Edit</a>
						<a href="<?php echo base_url('admin/group/delete/'.$group['id']); ?>" onClick="return confirm('คุณมั่นใจว่า จะลบtagนี้จิงๆ ใช่มั้ย !');" class="btn btn-danger">Delete</a> &nbsp; 
					</td>
				</tr>
		<?php
			} // End foreach
		?>
				</tbody>
			</table>
		<?php
		}else{
			echo "ไม่มีกลุ่ม";
		} // End if
		?>
</div>
